
#import "ViewController.h" 
#import "LSLHSBWhitePicker.h"

@interface ViewController ()

@property (nonatomic, strong) LSLHSBWhitePicker *whitePickerView;//颜色选择器的视图
@property (nonatomic, strong) UIView *LSLHSBWhitePickerView;

@property (weak, nonatomic) IBOutlet UIView *contentView;

@property (weak, nonatomic) IBOutlet UIView *testView;

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _whitePickerView = [[LSLHSBWhitePicker alloc] init];
    
    _LSLHSBWhitePickerView = [[[NSBundle mainBundle]loadNibNamed:@"LSLHSBWhitePicker" owner:nil options:nil]lastObject];
   
    _LSLHSBWhitePickerView.frame = CGRectMake(0, 0, _contentView.frame.size.height, _contentView.frame.size.width);

    [self.view addSubview: _contentView];
    
    [_LSLHSBWhitePickerView addSubview:_whitePickerView];
    
    [_contentView addSubview:_LSLHSBWhitePickerView];
    
    __weak typeof(self) weakSelf = self;
    
    [_whitePickerView colorSelectedBlock:^(UIColor *color, BOOL isConfirm) {
        /// do something...
        ///
        weakSelf.testView.backgroundColor = color;
    }];
}

- (void)viewWillLayoutSubviews {
    [super viewWillLayoutSubviews];
    self.whitePickerView.frame = self.contentView.bounds;
}

@end
